
begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	question = "Guard";
	text1 = "This guard has little useful to say to you. You make small talk for a while, but learn nothing of any importance.";
	action = END_TALK;

begintalknode 9;
	state = -1;
	nextstate = -1;
	question = "Giant Roach";
	text1 = "As you stare at the roach, you realize that you were actually thinking about talking to a roach. You feel the sudden urge to kick yourself.";
	text2 = "The roach just stares back at you.";

begintalknode 10;
	state = -1;
	nextstate = 10;
	question = "Captain Trechord";
	text1 = "You approach the soldier seated at the desk, and he rises to greet you. From your adventuring experience, you can guess that he's a captain, though the military system of this valley is a little confusing. In any case, he's an intimidating person.";
	text2 = "_Greetings, adventurers._ he begins, with a look bordering on disdain. _I am Captain Trechord, and I command the garrison here at Fort Ouranil. What do you need?_";
	text3 = "Hm... not a very pleasant person. With a grudge against adventurers, no less. Hopefully, he's not closely associated with the Order.";
	text5 = "Captain Trechord eyes you coldly. _What now?_";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	question = "What do you do here?";
	text1 = "_I command the troops here, isn't that obvious? We're here to keep the valley safe from any invaders, and we've had more than our fair share of duty._";
	text2 = "_Believe me, we're glad to see some adventurers here to relieve some of our burden,_ he says, his voice dripping with sarcasm. ";

begintalknode 12;
	state = 10;
	nextstate = -1;
	question = "Are there any jobs that need to be done around here?";
	text1 = "_Our military can take care of itself. We don't need adventurers running our errands._";

begintalknode 13;
	state = 10;
	nextstate = 13;
	condition = get_flag(0,1) != 1;
	question = "Is there something wrong with us?";
	text1 = "He glares at you, not even attempting to disguise his distrust. _You're adventurers. I've had bad experiences with adventurers._";
	text2 = "_I used to live in the grand city of Zaskiva, an Empire city on Morrow's Isle. My life was idyllic, and then some adventurers came to assassinate our ruler, the late Lord Volpe. They detonated a bomb in the center of our city, and everything was ruined._";
	text3 = "_The adventurers escaped before they could be caught. The town needed a scapegoat, so they blamed me for letting the bombers escape. I had to flee the city. Had I stayed, I'd have been killed instantly._";
	text4 = "_I had been a successful merchant, but those adventurers took it all away. I had to flee here, away from the Empire's influence, so that I could start fresh... with nothing. Adventurers have no concern for people's safety... only for their own whims._";
	text5 = "His glare turns to a scowl. _That is what is wrong with you._";
	code = 
		set_flag(0,1,1);
	break;
begintalknode 14;
	state = 13;
	nextstate = -1;
	question = "But we're here to help find Ephesos.";
	text1 = "_I know that. Just stay away from our towns while you're doing it._ ";
	text2 = "His glare gets just a bit more intense. Maybe it'd be good to leave him alone.";
	text3 = "You're also willing to bet that Trechord won't help you prove your worth to Oakleaf.";
	code = 
		if((get_flag(1,5) == 1) && (has_special_item(0) != 1)) {
			add_string(3);
		}
		else {
		remove_string(3);
	}
	break;
begintalknode 20;
	state = -1;
	nextstate = 20;
	question = "Loranzo";
	text1 = "An irritable-looking wizard is hard at work in this small lab. He doesn't seem bothered at all by the giant cockroach in the pit, though he looks angry in general.";
	text2 = "_Well, what do you want? I have to get back to work, I don't have time for this! So much to do..._";
	text3 = "He realizes that you haven't left yet. _Are you in the right place? I'm Loranzo, the fort's only mage. So, tell me... why are you wasting my time?_";
	text5 = "Loranzo glares at you. _Well?_";
	action = INTRO;

begintalknode 21;
	state = 20;
	nextstate = 21;
	question = "What are you working on?";
	text1 = "Loranzo pauses for a second, then starts talking quickly and angrily. _Well, I'm working on a way to kill the lizards right now... but all I've managed is to summon a giant cockroach._";
	text2 = "_Captain Trechord expects me to work miracles, but I just can't with so little time. I've been working with him for years, and he just expected me to do all of this work for him. I can't stand him._";
	text3 = "Turning back to his work, Loranzo continues. _Anyway, I don't have time to deal with adventurers, so leave me in peace!_";

begintalknode 22;
	state = 21;
	nextstate = -1;
	question = "Are you close to finding a way of defeating the lizards?";
	text1 = "Lorenzo starts speaking even quicker than before, in a tone of voice which screams 'death threat'.";
	text2 = "_No. Leave me alone. I need to keep working, so go kill some lizards yourself!_";
	action = END_TALK;

begintalknode 23;
	state = 20;
	nextstate = 22;
	question = "Can you teach me anything?";
	text1 = "_Yes, I can teach spells, but make it quick! I need to get back to work!_";

begintalknode 24;
	state = 22;
	nextstate = -1;
	question = "Alright, teach me some spells.";
	text1 = "Loranzo finishes the lesson, and continues his work.";
	code = 
		begin_shop_mode("Loranzo's Spells", "Loranzo gets even more irritable as you ask what spells he can teach. You really start wondering how anyone can stand working with him, but at least he knows what he's talking about. Probably, anyway.", 13, 4, -1);
	break;
	action = END_TALK;

begintalknode 25;
	state = 20;
	nextstate = -1;
	question = "What do you think of the Order?";
	text1 = "_They're no good to work with, they take too long on everything. I don't care how 'in tune with nature' they are, they couldn't help me if they tried. I'm beyond them!_";
	text2 = "Despite how confident Loranzo seems about this, you bet that Ephesos's presence would silence him. If only he were here...";
	text3 = "Still, it appears that Loranzo won't get you any closer to helping Oakleaf find Ephesos.";
	code = 
		if((get_flag(1,5) == 1) && (has_special_item(0) != 1)) {
			add_string(3);
		}
		else {
		remove_string(3);
	}
	break;
begintalknode 26;
	state = 21;
	nextstate = -1;
	question = "What are you going to do about the cockroach?";
	text1 = "_Not sure, don't care, NO TIME!_";

begintalknode 27;
	state = 22;
	nextstate = -1;
	question = "No thanks.";
	text1 = "_Then stop wasting my time!_";
	action = END_TALK;

begintalknode 30;
	state = -1;
	nextstate = 30;
	question = "Kindaro";
	text1 = "The nearly-oppressive heat in this forge doesn't seem to bother this man at all. In fact, he looks like he's enjoying the sweltering temperature. He quickly notices your presence and introduces himself.";
	text2 = "_Greetings, friends. I'm Kindaro, the only blacksmith in Fort Ouranil. What brings you to my forge?_";
	text3 = "Something seems unusual about Kindaro. Unlike many of the smiths you've met in your travels, Kindaro strikes you as unusually bright.";
	text5 = "_Yes?_ Kindaro says, waiting for you to say something.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	question = "What do you do here?";
	text1 = "_Well, I make most of the fort's weapons, though a few get sent up here from Relias. I can sell you some, but I can't promise exceptional quality, because our guards are using the best weapons right now._";
	text2 = "_In fact, most of the patrols still need upgrades for their gear, but we just can't make them fast enough._";
	code = 
		set_flag(0,4,1);
	break;
begintalknode 32;
	state = 31;
	nextstate = -1;
	question = "Can I buy some armor?";
	text1 = "Kindaro finishes showing you his depleted stocks.";
	text2 = "_I'm sorry, but that's the best we can do right now._";
	code = 
		begin_shop_mode("Kindaro's Armor", "Kindaro shows you his armor stocks (at least the part that didn't go to the armory), and you can't help but worry about this army's strength. At least he offers to buy some of your treasure.", 0,3,3);
	break;
begintalknode 33;
	state = 31;
	nextstate = -1;
	question = "How about some weapons?";
	text1 = "Kindaro puts away what's left of his stock.";
	text2 = "_I should probably get working on the next batch of blades,_ he says calmly.";
	code = 
		begin_shop_mode("Kindaro's Weaponry", "Kindaro shows you his weaponry stocks (at least the part that didn't go to the armory), and you can't help but worry about this army's strength. At least he offers to buy some of your treasure.", 1,3,3);
	break;
begintalknode 34;
	state = 31;
	nextstate = -1;
	question = "I don't need any gear right now.";
	text1 = "_Fine by me,_ Kindaro says. _I need to get working on the next batch of spearheads anyway._";
	action = END_TALK;

begintalknode 35;
	state = 30;
	nextstate = 32;
	question = "What do you think of the valley's situation right now?";
	text1 = "_Not good._ Kindaro says, suddenly turning serious. _Our army's supplies are dwindling, and we lose a few soldiers every day now. Delran in Relias is so busy helping out the other towns that he can't help me supply the army._";
	text2 = "_I haven't slept in three days, and even the Order is panicking with Ephesos gone. These are truly dark days for our valley. All I can say is that we're happy to have you adventurers helping us out._";

begintalknode 36;
	state = 32;
	nextstate = 33;
	condition = ((get_flag(1,5) == 1) && (get_flag(0,5) != 1));
	question = "One problem: Brother Oakleaf won't let us help him find Ephesos.";
	text1 = "You explain Oakleaf's conditions for helping find Ephesos.";
	text2 = "Kindaro looks puzzled. _That's worrying... normally Oakleaf would be glad for the help. It sounds like he just doesn't want you to interfere with his plans, really._";
	text3 = "_If it's any consolation, I give you my blessing. I can't really see Loranzo or Captain Trechord helping you, they're way too uptight about everything... and the lizards aren't helping matters._";
	code = 
		if(get_flag(0,5) != 1) {
			inc_flag(100,2,1);
		}
		set_flag(0,5,1);
	break;
